<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>TODO supply a title</title>
    </h:head>
    <link href="CSS/Style.css" rel="stylesheet" type="text/css" />
    <h:body>
        <ui:composition template="./HomeTemp.xhtml">
            <ui:define name="eventcontent">
                Register
            </ui:define>
            <ui:define name="listevent">
                <div style="margin-left: 200px">
                    <h:form>
                        <table>
                            <tr>
                                <td>UserName: </td>
                                <td><p:inputText id="uName" value="#{registerBean.registerEntities.userName}" required="true" requiredMessage="You must input username!"></p:inputText></td>
                                <p:message id="uNameMessage" for="uName" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td>Password: </td>
                                <td><p:password id="uPass" value="#{registerBean.registerEntities.password}" required="true" requiredMessage="You must input password!"></p:password></td>
                                <p:message id="uPassMessage" for="uPass" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td>Name: </td>
                                <td><p:inputText id="uFullName" value="#{registerBean.registerEntities.registerName}" required="true" requiredMessage="You must FullName!"></p:inputText></td>
                                <p:message id="uFullNameMessage" for="uFullName" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td>Email: </td>
                                <td><p:inputText id="uEmail" value="#{registerBean.registerEntities.email}" required="true" requiredMessage="You must input email address!"></p:inputText></td>
                                <p:message id="uEmailNameMessage" for="uEmail" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td>Phone: </td>
                                <td><p:inputText id="uPhone" value="#{registerBean.registerEntities.phone}" required="true" requiredMessage="You must input Phone!"></p:inputText></td>
                                <p:message id="uPhoneNameMessage" for="uPhone" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td>Gender: </td>
                                <td><p:selectOneMenu value="#{registerBean.registerEntities.gender}" required="true" >
                                        <f:selectItem itemLabel="Male" itemValue="1" ></f:selectItem>
                                        <f:selectItem itemLabel="Female" itemValue="2" ></f:selectItem>
                                        <f:selectItem itemLabel="Orther" itemValue="3" ></f:selectItem>
                                    </p:selectOneMenu></td>
                            </tr>
                            <tr>
                                <td>Image: </td>
                                <td>
                                    <p:messages showDetail="true"/> 
                                    <p:fileUpload id="uImage" mode="simple" value="#{registerBean.registerEntities.images}" requiredMessage="You must input Image!"></p:fileUpload>
                                    <p:message id="uImageNameMessage" for="uImage" display="text" showDetail="true"/>
                                </td>
                            </tr>
                            <tr>
                                <td>Address: </td>
                                <td><p:inputText id="uAddress" value="#{registerBean.registerEntities.address}" required="true" requiredMessage="You must input address!"></p:inputText></td>
                                <p:message id="uAddressNameMessage" for="uAddress" display="text" showDetail="true"/>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <h:panelGroup style="display:block; align: center">
                                        <p:messages showDetail="true" autoUpdate="true"/> 
                                        <p:commandButton value="Register" action="#{registerBean.InsertRegister()}" />
                                        <h:outputText value="  "/>
                                        <p:commandButton value="Reset" type="reset"/>
                                    </h:panelGroup>
                                </td>
                            </tr>
                        </table>
                    </h:form>
                </div>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
